local fengzun = fk.CreateSkill {
  name = "emo__fengzun",
}

fengzun:addEffect(fk.TargetSpecified, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(fengzun.name) and data.to ~= player
    and (data.card.suit == Card.Spade or (data.card.color == Card.Black and data.card.type == Card.TypeTrick))
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {skill_name = fengzun.name, prompt = "#emo__fengzun-invoke:"..data.to.id})
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(1, fengzun.name)
    local to = data.to
    if not to.chained and not to.dead then
      to:setChainState(true)
    end
  end,
})


Fk:loadTranslationTable{
  ["emo__fengzun"] = "奉尊",
  [":emo__fengzun"] = "每当你使用♠牌或黑色锦囊牌指定一名其他角色为目标后，你可以摸一张牌并横置该角色。",
  ["#emo__fengzun-invoke"] = "奉尊：你可以摸一张牌，并横置 %src",
}

return fengzun
